<?php 
 
 /*function add($a,$b)
  {
      return $a+$b;
     $c=add(1,3);
     echo $c;

  } jia fa*/
/*function f($array,$s)
{     $str="";
       for($i=0;$i<count($array);$i++)
	{$str.=$array[$i];
   if($i!=count($array)-1)
   	$str.=$s;
}
return $str;
}
  $str=array("a","b","c","d");
  $result=f($str,"===");
   echo $result;*/

$str=array("2""2""2");
$result=implode($str, "-");
echo $result;
 ?>

 <?php 
 function get($filename)
 {
$start=strpos($filename,".");
$len=strlen($filename)-$start-1;
echo substr($filename,$start+1,$len);

 }
 get("abc.txt");

$suffix=strrchr("bcd.doc",'.')
;
 ?>
 <?php 
 function i($filename)
 {
     $allowtype=array("jpg","jpeg","png","gif","Bmp","flv");
     $suffix=strrchr($filename);
		for($i=0;$i<count(allowtype);$i++)
			if($suffix=$allowtype[$i])
            return true;
        return false;
 }
 if(i("test.text"))
 	echo "true"
else
	echo "not"
 ?>